package contact.domain;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class DAOPhoneNumber extends HibernateDaoSupport{
	
	public DAOPhoneNumber(){
	}
	
	public static DAOPhoneNumber createInstance(){
		return new DAOPhoneNumber();
	}
	
	public Long create(PhoneNumber phone){
		return (Long) getHibernateTemplate().save(phone);
	}
	
	public PhoneNumber read(Long id){
		return (PhoneNumber) getHibernateTemplate().find("from PhoneNumber where id='"+id+"'");
	}
	
	public void update(PhoneNumber phone){
		getHibernateTemplate().update(phone);
	}
	
	public void delete(PhoneNumber phone){
		getHibernateTemplate().delete(phone);
	}
}
